<template>
	<view>
		<view v-if="showStore && item.store" class="flex space alcenter mb20">
			<view class="flex alcenter">
				<app-icon :name="item.store.logo || `https://picsum.photos/60/60?seed=${item.id}`" type="image" custom-class="unio2o-store-logo" />
				<view class="ml20 ft16 text-default">
					{{ item.store.name || '店铺名称' }}
				</view>
			</view>
			<view class="ft14 text-notice">
				<text>距我</text>
				<text class="text-theme">{{ item.store.distance || '1.0km' }}</text>
			</view>
		</view>
		<navigator :url="`/pages/tuan/detail?id=${item.id}`">
		<view class="pd30 bdr16 bg-w box-shadow flex">
			<view class="wh120">
				<image :src="item.image" mode="aspectFill" custom-class="bdr16" />
			</view>
			<view class="ws120 pl20">
				<view class="ft16 ftw600 text-main text-over2">
					{{ item.title || '商品标题' }}
				</view>
				<view class="flex alcenter mt20">
					<view v-if="item.isHot" class="tag tag-hot flex alcenter">
						<app-icon name="icon_hot1" type="iconfont" />
						<text class="ml10">火爆</text>
					</view>
					<view class="tag tag-info ml20">
						{{ item.promotionCount || 0 }}人推广
					</view>
				</view>
				
				<view class="flex alcenter mt10">
					<view class="text-price">
						<text class="ft14">￥</text>
						<text class="ft16 ftw600">{{ item.price || 0 }}</text>
					</view>
					<view class="text-notice text-line ft12 ml10">
						¥{{ item.originalPrice || 0 }}
					</view>
					<view class="ft12 ml30 tag-zk text-w">{{ item.discount || '1.0' }}折</view>
				</view>
				
				<view class="flex alcenter mt20">
					<view class="tag-sf bg-yellow flex alcenter">
						<text class="ft12">会员返</text>
						<text class="ft14">￥{{ item.memberReturn || 0 }}</text>
					</view>
					<view class="tag-sf bg-main flex alcenter ml20">
						<text class="ft12">赚</text>
						<text class="ft14">￥{{ item.commissionAmount || 0 }}</text>
					</view>
				</view>
			</view>
		</view>
		</navigator>
	</view>
</template>

<script>
	export default{
		props:{
			showStore:{
				type:Boolean,
				default:true
			},
			item:{
				type:Object,
				required:true,
				default:() => ({
					id: 1,
					title: '',
					image: '',
					price: 0,
					originalPrice: 0,
					discount: '1.0',
					memberReturn: 0,
					commissionAmount: 0,
					promotionCount: 0,
					isHot: false,
					store: {
						name: '',
						logo: '',
						distance: '0km'
					}
				})
			}
		},
		data(){
			return {}
		}
	}
</script>

<style>
</style>